﻿using NUnit.Framework;

namespace Simhopp.Common
{
    /// <summary>
    /// A test class for the Credentials class.
    /// </summary>
    [TestFixture]
    class TestCredentials
    {
        #region FIELD REGION
        private Credentials defaultCredentials;
        private Credentials credentials;
        #endregion
        #region ALTERNATIVE 1

        [SetUp]
        public void Init()
        {
            defaultCredentials = new Credentials();
            credentials = new Credentials
            {
                Name = "Arne Hegerfors",
                Gender = Genders.Male,
                Age = 78,
                Nationality = "Sweden",
                SocialSecurityNumber = "194211058946"
            };
        }

        [Test]
        public void TestConstructors()
        {
            Assert.AreEqual("Arne Hegerfors", credentials.Name);
            Assert.AreEqual(Genders.Male, credentials.Gender);
            Assert.AreEqual(78, credentials.Age);
            Assert.AreEqual("Sweden", credentials.Nationality);
            Assert.AreEqual("194211058946", credentials.SocialSecurityNumber);

            
        }

        [Test]
        public void TestProperties()
        {
            defaultCredentials.Name = "Sven-Göran Eriksson";
            defaultCredentials.Gender = Genders.Male;
            defaultCredentials.Age = 67;
            defaultCredentials.Nationality = "USA";
            defaultCredentials.SocialSecurityNumber = "196509148743";

            Assert.AreEqual("Sven-Göran Eriksson", defaultCredentials.Name);
            Assert.AreEqual(Genders.Male, defaultCredentials.Gender);
            Assert.AreEqual(67, defaultCredentials.Age);
            Assert.AreEqual("USA", defaultCredentials.Nationality);
            Assert.AreEqual("196509148743", defaultCredentials.SocialSecurityNumber);
        }

        [TearDown]
        public void Terminate()
        {
        }
        #endregion
        #region ALTERNATIVE 2
        //[Test]
        //public void TestSetName()
        //{
        //    //Add string name
        //    Credentials TestC1 = new  Credentials();
        //    TestC1.Name = "Olle Olsson";

        //    Assert.AreEqual(TestC1.Name, "Olle Olsson");

        //    Credentials TestC2 = new Credentials();
        //    TestC2.Name = "Bob";

        //    Assert.AreEqual(TestC2.Name, "Bob");
        //    Assert.AreNotEqual(TestC2.Name, "bob");

        //    Assert.AreNotSame(TestC1.Name, TestC2.Name);
        //}
        //[Test]
        //public void TestSetAge()
        //{
        //    Credentials TestC1 = new Credentials();
        //    TestC1.Age = 35;

        //    Credentials TestC2 = new Credentials();
        //    TestC2.Age = 40;

        //    Assert.AreEqual(TestC1.Age, 35);
        //    Assert.AreEqual(TestC2.Age, 40);

        //    Assert.AreNotEqual(TestC1, TestC2);
        //    Assert.AreNotSame(TestC1, TestC2);
        //}
        //[Test]
        //public void TestGender()
        //{
        //    Credentials TestC1 = new Credentials();
        //    TestC1.Gender = Genders.Male;

        //    Assert.AreEqual(TestC1.Gender, Genders.Male);

        //    Credentials TestC2 = new Credentials();
        //    TestC2.Gender = Genders.Female;

        //    Assert.AreEqual(TestC2.Gender, Genders.Female);

        //    Assert.AreNotEqual(TestC1.Gender, TestC2.Gender);
        //}
        //[Test]
        //public void TestNationallity()
        //{
        //    Credentials TestC1 = new Credentials();
        //    TestC1.Nationality = "Sweden";

        //    Assert.AreEqual(TestC1.Nationality, "Sweden");

        //    Credentials TestC2 = new Credentials();
        //    TestC2.Nationality = "Soviet Union";

        //    Assert.AreNotEqual(TestC2, "America");

        //    Assert.AreNotEqual(TestC1, TestC2);
        //}
        #endregion
    }
}
